﻿@model ResourcesViewModel

@{
	ViewBag.Title = Html.GetGlobalResource("PagesTitles", "AdminResources");
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
}

<h2>@Html.GetGlobalResource("PagesTitles", "AdminResources")</h2>
<table>
	<tr>
		<th>@Html.GetLocalResource("Resource")</th>
		<th>@Html.GetLocalResource("Object")</th>
		@foreach (var culture in Model.Cultures) {
			<th>@Html.GetFullCultureName(culture)</th>
		}
	</tr>
	@foreach (var item in Model.Items) {
		<tr>
			<td>@item.ResourceObject</td>
			<td>@item.ResourceName</td>
			@foreach (var culture in Model.Cultures) {
				if (item.CultureValues.ContainsKey(culture)) {
					<td>@item.CultureValues[culture]</td>
				}
				else {
					<td></td>
				}
			}
		</tr>
	}
</table>
<br/><br/>
@using (Html.BeginForm("ExportResources", "Admin", FormMethod.Post)) {
	<input type="submit" value="@Html.GetLocalResource("Export")"/>
}
@using (Html.BeginForm("ImportResources", "Admin", FormMethod.Post, new {enctype = "multipart/form-data"})) {
	<input type="file" name="file" />
	<input type="submit" value="@Html.GetLocalResource("Import")" />
}